{extend name='extra@admin/content'}

{block name="button"}
<a class="layui-btn layui-btn-danger " href="javascript:;" style="text-decoration: none"
   target="_blank" style="float:left;">数量：{$num}</a>
<a class="layui-btn layui-btn-danger " href="javascript:;" style="text-decoration: none"
   target="_blank" style="float:left;">成本：￥{$chengben}</a>
<a class="layui-btn layui-btn-danger " href="javascript:;" style="text-decoration: none"
   target="_blank" style="float:left;">利润：￥{$profit}</a>
<div class="nowrap pull-right" style="margin-top:10px">
      <a href='{:url("kuguan/gongchang/export_salegoods")}?date={$Think.get.date}' class="layui-btn layui-btn-small" style="text-decoration:none"><i class="fa fa-mail-forward"></i>
          导出
      </a>
</div>
{/block}

{block name="content"}

<!-- 表单搜索 开始 -->
<form class="animated form-search" action="__SELF__" onsubmit="return false" method="get">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">下单时间</label>
        <div class="layui-input-inline">
            <input name="date" id='range-date' value="{$Think.get.date|default=''}"
                   placeholder="请选择时间" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>
</form>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    {if empty($list)}
        <p class="help-block text-center well">暂无数据！</p>
    {else /}
    <table class="layui-table" lay-skin="line" lay-size="sm">
        <thead>
            <tr>
                <th class='text-left nowrap'>商品</th>
                <th class='text-left nowrap'>属性</th>
                <th class='text-left nowrap'>数量</th>
                <th class='text-left nowrap'>交易总价</th>
                <th class='text-left nowrap'>优惠</th>
                <th class='text-left nowrap'>成本</th>
                <th class='text-left nowrap'>利润</th>
            </tr>
        </thead>
        <tbody>
            {volist name='list' id='vo'}
                <tr>
                    <td class='text-left nowrap'>
                        {$vo.name}
                    </td>
                    <td class='text-left nowrap'>
                        {if $vo.title == ''}
                            无属性
                        {else /}
                            {$vo.title}
                        {/if}
                    </td>
                    <td class='text-left nowrap'>
                        {$vo.goods_num}
                    </td>
                    <td class='text-left nowrap'>
                        {$vo.final_amount}
                    </td>
                    <td class='text-left nowrap'>
                        {if $vo.discount == 0}
                            0
                        {else /}
                            {$vo.discount}
                        {/if}
                    </td>
                    <td class='text-left nowrap'>
                        {if $vo.chengben == ''}
                            0
                        {else /}
                            {$vo.chengben}
                        {/if}
                    </td>
                    <td class='text-left nowrap'>
                        {if $vo.profit == ''}
                            0
                        {else /}
                            {$vo.profit}
                        {/if}
                    </td>
                </tr>
            {/volist}
        </tbody>
    </table>
    {if isset($page)}<p>{$page}</p>{/if}
    {/if}
    <script>
        window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});
    </script>
</form>
{/block}